﻿using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using Moonwish.SchoolDorms.BusinessComponent.Utility;
using Moonwish.SchoolDorms.DataEntity.Menus;

namespace Moonwish.SchoolDorms.BusinessComponent.Menus
{
    public class MenuManager
    {
        /// <summary>
        /// 获取系统菜单。
        /// </summary>
        /// <returns></returns>
        public List<Menu> GetMenus()
        {
            var menus = new List<Menu>();
            using (var conn = new OleDbConnection(WebConfig.ConnectionString))
            {
                conn.Open();
                using (var adp = new OleDbDataAdapter("select * from T_Menu", conn))
                {
                    var dataTable = new DataTable();
                    adp.Fill(dataTable);
                }
            }
            return menus;
        }
    }
}
